Repository navigation
Upload diagnostics, adaptive request size, and upload scheduling - #11
Merged
Merged
Conversation
- SyncDiagnostics: record each request (prepare, connect, send, server, delete, rest, retry wait) using URLSessionTaskMetrics, summarize each sync with its bottleneck, and post Notification.Name.Aware.dbSyncDiagnostics. - SyncBatchLimit: 4 MB default for every server type (the PHP AWARE server is retired; Flask serves its endpoints). After 3 full and fast requests in a row the limit grows by half up to maxBatchBytesCeiling (8 MB by default), like AWAREFetchSizeAdjuster. A limit learned from 413 grows back, but never above 90% of the smallest rejected size. - prefetchNextBatch: choose and build the next request while the current one is in flight. - DbSyncConfig.default* static values let an app set the request size and pacing of every sensor at once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upload diagnostics, adaptive request size and request prefetch
SyncDiagnosticsrecords each request (prepare, connect, send, server, delete, rest, retry wait) fromURLSessionTaskMetrics, summarizes each sync with its bottleneck, and postsNotification.Name.Aware.dbSyncDiagnostics.SyncBatchLimituses 4 MB by default for every server type (the PHP AWARE server is retired; Flask serves its endpoints). After 3 full, fast requests in a row the limit grows by half, up tomaxBatchBytesCeiling(8 MB by default). A limit learned from a 413 grows back, but never above 90% of the smallest rejected size.prefetchNextBatchbuilds the next request while the current one is in flight.DbSyncConfig.default*static values let an app set the request size and pacing of every sensor at once.Upload scheduling and encoding
UploadScheduler: decides when to upload (interval timer, the device starting to charge, background uploads throughBGProcessingTask), and tracks Wi-Fi (NWPathMonitor) and charging state.UploadJSONBytes/SQLiteEngine.appendUploadJSON: encode upload rows straight from the SQLite C API into JSON bytes, reusing repeated text values. Process-wide upload cancellation (stopAllSyncs), AWARE Hub request format, and batch metrics (batchHandler).SQLiteEnginesaves and the scheduler.Test plan
feature/upload-diagnostics) builds with this branch and runs on an iPhone 15 Pro, with uploads and sensing working🤖 Generated with Claude Code